//var a = require('snabbdom');

//import snabbdom from 'snabbdom'

import {h} from 'snabbdom/build/package/h'
import {thunk} from 'snabbdom/build/package/thunk'
import {init} from 'snabbdom/build/package/init'
console.log(h,thunk,init)

// 1 hello world

// 2.deiv


let patch = init([])//对比vnode差异，更新到真实dom

//1 标签+选择齐
//2 字符串的话就说标签中的内容
 
let vnode = h('div#container.cls',{
    hook:{
        init(vnode){
            console.log (vnode.elm)
        },
        create(emptyVnode,vnode){
            console.log (vnode.elm)
        }
    }
},'hello world')

let app = document.querySelector('#app')
//第一个参数可以是dom元素，把dom你元素换成Vnode
//第二个参数VNODE
//返回vnode
let oldVnode = patch(app,vnode)

vnode = h ('div','hello Snabbdom')

patch (oldVnode,vnode)
